#include "stdafx.h"
#include "namesp.h"
#include <iostream>


namesp::namesp(void)
{
}


namesp::~namesp(void)
{
}

namespace pers{
	using std::cout;
	using std::cin;
	using std::endl;
	void getPerson(Person &p){
		cout << "Enter first name:" <<endl;
		cin >>p.fname;
		cout << "Enter last name:" <<endl;
		cin >> p.lname;
	};

	void showPerson(const Person &p){
		std::cout << p.fname<<"," <<p.lname <<endl;
	}
}

namespace debts{
	void getDebt(Debt &d){
		getPerson(d.name);
		std::cout << "Enter debt:" <<endl;
		std::cin >> d.amount;
	};

	void showDebt(const Debt &d){
		showPerson(d.name);
		std::cout <<":$" <<d.amount << endl;
	};

	double sunDebts(const Debt debts[],int n){
		double total = 0;
		for(int i=0;i<n;i++){
			total +=debts[i].amount;
		}
		return total;
	};
}